<?php

namespace App\Observers;

use App\Model\Config;

class ConfigObserver
{
    public function created ( Config $config )
    {
        $this->cache ();
    }

    public function saved ( Config $config )
    {
        $this->cache ();
    }
    public function cache ()
    {
        \Cache::forever ( 'hd_config' , Config::pluck ( 'data' , 'name' ) );
    }
}
